package com.wiz.weixin.manager;

import org.springframework.stereotype.Component;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.wiz.weixin.common.Constant;
import com.wiz.weixin.common.GlobalConstant;
import com.wiz.weixin.tencent.VO.UserInfoVo;
import com.wiz.weixin.util.JSSDKUtil;

/***
 * 
 * @author xxy
 *
 */
@Component("commonManager")
public class CommonManager {
	private Gson gson = new GsonBuilder().disableHtmlEscaping().create();
	/**得到客户的基本信息*/
	public UserInfoVo getUserInfo(String openId){
		String url = Constant.USER_INFO_URL;
		url = url.replace("TOKEN", GlobalConstant.tencent_wx_token);
		url = url.replace("OPENID", openId);
		String result = JSSDKUtil.httpsRequest(url, "POST", null);
		System.out.println(result);
		return gson.fromJson(result, UserInfoVo.class);
		
	}

}
